package ch4;

import java.util.Scanner;

public class ComTest {

	public static void main(String[] args) {
		Company com = new Company("大富豪土豆有限公司", "6299039393", "巢湖旁边");

		Scanner in = new Scanner(System.in);
		int ch = 0;

		while (true) {
			System.out.println("1:查看公司情况\n2:雇佣新人\n3:开除员工\n5:找薪水最高的人\n9:退出");
			ch = in.nextInt();
			if (ch == 1) {
				com.showCompanyinfo();
			} else if (ch == 2) {
				Employee e = new Employee();
				System.out.println("输入员工基本信息：");
				System.out.println("姓名：");

				e.name = in.next();
				System.out.println("工号：");
				e.number = in.next();
				System.out.println("职务：");
				e.position = in.next();
				System.out.println("薪水：");
				e.salary = in.nextDouble();
				System.out.println("年龄：");
				e.age = in.nextInt();
				System.out.println("性别：");
				e.sex = in.next();

				boolean f = com.hire(e);
				System.out.println(f ? "成功" : "失败");
			} else if (ch == 3) {

			} else if (ch == 5) {
				Employee top = com.findTopSalary();
				System.out.println("薪水最高的人信息如下：");
				if (top == null) {
					System.out.println("目前没人");
				} else {
					top.showinfo();
				}
			} else if (ch == 9) {
				break;
			}
		}
	}

}
